package com.he.statemodel.state.concretestate;

import com.he.statemodel.context.WorkContext;
import com.he.statemodel.state.WorkState;

public class EveningState implements WorkState {
    @Override
    public void handle(WorkContext workContext) {
        if (workContext.getWorkHour() < 18) {
            System.out.println("晚上了，工作不知道完成没！");
        } else {
            if (workContext.isFinished()) {
                workContext.setWorkState(new RestState());
                workContext.workhandle();
            } else {
                workContext.setWorkState(new OvertimeState());
                workContext.workhandle();
            }
        }
    }
}
